package com.tang4j.service.impl;

import com.tang4j.core.service.impl.AbstractServiceImpl;
import com.tang4j.mapper.ThSysNavigationRoleInfoMapper;
import com.tang4j.model.ThSysNavigationRoleInfo;
import com.tang4j.service.ThSysNavigationRoleInfoService;
import com.tang4j.service.ThSysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;

/**
 * <p>
 * 用户角色表 服务实现类
 * </p>
 *
 * @author saber
 * @since 2019-11-29
 */
@Service
public class ThSysNavigationRoleInfoServiceImpl extends AbstractServiceImpl<ThSysNavigationRoleInfoMapper, ThSysNavigationRoleInfo> implements ThSysNavigationRoleInfoService {

    @Autowired
    private ThSysRoleService roleService;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void deleteById(Serializable id) {
        ThSysNavigationRoleInfo thSysNavigationRoleInfo = this.selectById(id);
        roleService.deleteById(thSysNavigationRoleInfo.getRoleId());
        super.deleteById(id);
    }
}
